/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-09-19 20:26:24
 * @LastEditors: Aroma
 * @LastEditTime: 2024-09-19 21:11:21
 * @别瞎看: 你个无脑牛马
 */
public class Test17{
    public static void main(String[] args) {
        Animal a=new Dog();
        a.speak();
        if (a instanceof Dog) {
            Dog dog = (Dog) a;
            dog.wagTail();
        } else {
            System.out.println("This animal cannot wag its tail.");
        }
    }
}